package com.example.android.test.project2;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;

public class DisplayStoredDataActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_display_stored_data);
        //Getting data from shared preferences
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        String data = prefs.getString(ResultsPageActivity.DATANAME, "N/A");
        TextView storedData = (TextView)findViewById(R.id.stored_data);
        storedData.setText(data);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_display_stored_data, menu);
        return true;
    }
    
    public void launchProtected(View view) {
      Intent intent = new Intent(this, ProtectedPageActivity.class);
      startActivity(intent);
    }

    


}
